import { request } from '@gui-pkg/request';
enum Api {
  getBasin = '/api/gq/baseinfo/basin/list',//河流
  getGq = '/api/gq/st/stbprpb/list',//渠道

  getHistory = '/api/gq/st/stat/page',//历史查询
  getHistoryAnalyse = '/api/gq/st/pptn/stat/accp',//分析对比，历史对比，雨量
  getEigenValue = '/api/gq/st/pptn/stat/year',//分析对比，典型特征值，雨量
  getHistoryWater = '/api/gq/st/stat/day',//历史对比
  getEigenValueWater = '/api/gq/st/stat/year',//典型特征

  getStbprpbInfo = '/api/gq/st/stbprpb/info',//测站信息
  getEquipList = '/api/gq/st/equip/list',//设备信息列表
  getEquipInfo = '/api/gq/st/equip/order/list',//设备养护信息

  getStType = '/api/gq/st/stbprpb/getStbprpBType',
  getSummary = '/api/gq/st/monitor/summary/findList',
  getGateRunList = '/api/gq/st/monitor/summary/getGateRunList',
  getGqStRsvrPage = "/api/gq/st/rsvr/page",

  EditCropsInfo = '/api/gq/baseinfomanager/edit/waterCropsInfo', // 保存或修改农作物种植结构
  CropsInfoList = '/api/gq/baseinfomanager/find/cropsInfo/list', // 获取农作物种植结构数据
  WaterCropsList = '/api/gq/baseinfomanager/findWaterCropsList',
  PositionList = '/api/gq/baseinfomanager/findPositionList',  // 获取灌区灌片

  getRainIso = "/watercontrol/platform-model/api/bus/model/drought/getRainIso",  //获取等值面数据

  getRZWCurve = '/api/hsyb/business/hsybForecastc/rzWCurve', // 水库库容关系
  RsvrByYrAndFilter = '/api/gq/onemap/selectRsvrByYrAndFilter', //根据多个年份或月、日、旬查询水库均值

  gatePage = "/api/gq/st/gate/page",
  findMonitorRunStatistics = "/api/gq/st/equip/findMonitorRunStatistics",

  WarnInfoCount = '/api/gq/warn/info/count',
  WarnInfoList = '/api/gq/warn/info/list',

  ReviseData = '/api/gq/st/revise/data'
}

//水库列表
export const getGqStRsvrPage = (params) => {
  return request.post({ url: Api.getGqStRsvrPage, params });
};


//河道列表
export const getRiver = (type, params) => {
  return request.post({ url: `/api/gq/st/${type}/page`, params });
};
export const getBasin = () => {
  return request.post({ url: Api.getBasin });
};
export const getGq = (params) => {
  return request.post({ url: Api.getGq, params });
};

// 雨量站列表
export const getRainList = () => {
  const params = { limit: 100, start: 1 };
  return request.post({ url: `/api/gq/st/pptn/page`, params });
};


//历史查询
export const getHistory = (params) => {
  return request.post({ url: Api.getHistory, params });
};
//分析对比  雨情
export const getHistoryAnalyse = (params) => {
  return request.post({ url: Api.getHistoryAnalyse, params });
};
export const getEigenValue = (params) => {
  return request.post({ url: Api.getEigenValue, params });
};
//分析对比 水情
export const getHistoryWater = (params) => {
  return request.post({ url: Api.getHistoryWater, params });
};
export const getEigenValueWater = (params) => {
  return request.post({ url: Api.getEigenValueWater, params });
};

//详情
export const getStbprpbInfo = (params) => {
  return request.post({ url: Api.getStbprpbInfo, params });
};
export const getEquipList = (params) => {
  return request.post({ url: Api.getEquipList, params });
};
export const getEquipInfo = (params) => {
  return request.post({ url: Api.getEquipInfo, params });
};
//过程线
export const getChartStep = (type, params) => {
  return request.post({ url: `/api/gq/st/${type}/stat/step`, params });
};
//历史对比
export const getChartHistory = (type, params) => {
  return request.post({ url: `/api/gq/st/${type}/stat/day`, params });
};
//特征值
export const getChartTz = (type, params) => {
  return request.post({ url: `/api/gq/st/${type}/stat/year`, params });
};
export const getStType = () => request.get({ url: Api.getStType });


//汇总
export const getSummary = () => {
  return request.get({ url: Api.getSummary });
};
export const getGateRunList = (params) => {
  return request.post({ url: Api.getGateRunList, params });
};
export const findMonitorRunStatistics = () => {
  return request.get({ url: Api.findMonitorRunStatistics });
};
export const gatePage = (params) => {
  return request.post({ url: Api.gatePage, params });
};

// 保存或修改农作物种植结构
export const editWaterCropsInfo = (params) => {
  return request.post({ url: Api.EditCropsInfo, params });
}

//获取农作物种植结构数据
export const getCropsInfoList = (params) => {
  return request.get({ url: Api.CropsInfoList, params });
};

// 获取种植作物管理
export const getCropsList = () => {
  return request.get({ url: Api.WaterCropsList });
};

// 删除农作物种植结构
export const deleteCropsList = (id) => {
  return request.post({ url: `/api/gq/baseinfomanager/del/waterCropsInfo/${id}` });
}

// 获取灌区灌片
export const getIrrigatedAreaList = () => {
  return request.get({ url: Api.PositionList });
}

// 雨量等值面数据
export const getRainAreaData = (params) => {
  return request.get({ url: Api.getRainIso, params });
};

// 水库库容关系
export const getRZWCurveData = (params) => {
  return request.get({ url: Api.getRZWCurve, params });
};

// 根据多个年份或月、日、旬查询水库均值
export const getRsvrByYrAndFilter = (params) => {
  return request.get({ url: Api.RsvrByYrAndFilter, params });
};

// 告警统计信息
export const getWarnInfoCount = () => {
  return request.get({ url: Api.WarnInfoCount });
};

// 查询当天告警信息
export const getWarnInfoList = () => {
  return request.get({ url: Api.WarnInfoList });
};

// 人工数据上传
export const addReviseData = (params) => {
  return request.post({ url: Api.ReviseData, params });
};
